package com.example.ccj.u;


public class GenerateId {
    /**
     * 获取不重复的雪花算法id
     * @return
     */
    public static long getId(){
        return SnowflakeIdWorker.getInstance().nextId();
    }

    /**
     * 获取不重复的雪花算法id
     * @return
     */
    public static String getIdToStr(){
        return String.valueOf(SnowflakeIdWorker.getInstance().nextId());
    }

    /**
     * 获取不重复的当前时间id
     * @return
     */
    public static long getNoRepeatTimeId(){
        return SnowflakeIdWorker.getInstance().getNoRepeatTimeId();
    }


    /**
     * 获取不重复的雪花算法id
     * @return
     */
    public static String getNoRepeatTimeIdToStr(){
        return String.valueOf(SnowflakeIdWorker.getInstance().getNoRepeatTimeId());
    }


}
